home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / Coldfusion / coldfusion-60-win-en.exe / bts.cfm15 < prev    next >
Encoding:
Text File  |  2002-03-18  |  1.1 KB  |  43 lines

  1. erved.
  2. *
  3. * YOUR RIGHTS WITH RESPECT TO THIS SOFTWARE IS GOVERNED BY THE
  4. * TERMS AND CONDITIONS SET FORTH IN THE CORRESPONDING EULA.
  5. *
  6. **
  7.  --->
  8.  
  9. <!--- Simple text box control --->
  10.  
  11. <cfif not isDefined("attributes.name")>
  12.     <cfthrow message="form:textbox: Must befine name attribute.">
  13. </cfif>
  14.  
  15. <cfparam name="attributes.defaultValue" default="">
  16.  
  17. <!---
  18.     Simple logic - if form.NAME exists, we must have
  19.     submitted the form - so use that value, otherwise
  20.     use the optional defaultValue parameter
  21. --->
  22. <cfif isDefined("form.#attributes.name#")>
  23.     <cfset value = form[attributes.name]>
  24. <cfelse>
  25.     <cfset value = attributes.defaultValue>
  26. </cfif>
  27.  
  28. <!--- render control --->
  29. <cfoutput><input type="text" name="#attributes.name#" value="#value#"</cfoutput>
  30.  
  31. <!--- Every other argument is optional, so we can just dump it on --->
  32. <cfloop item="arg" collection="#attributes#">
  33.     <cfif arg is not "name" and arg is not "defaultValue">
  34.         <cfoutput> #arg#="#attributes[arg]#"</cfoutput>
  35.     </cfif>
  36. </cfloop>
  37.  
  38. <cfoutput>></cfoutput>
  39. <cfsetting enableCFOutputOnly=0><!--- 
  40. **
  41. * CFMX Example Applications
  42. *
  43. * Copyright (c) 2002 Macromedia.  All Rights Rese